#ifndef CONNECTION_H
#define CONNECTION_H

#include <QTcpSocket>

class Connection : public QTcpSocket
{
  Q_OBJECT

public:
  Connection(QObject* parent=0);
  void connectToServer( QString, QString, QString, int );
  void sendCommand( const QString&, bool hide=false );

private slots:
  void readIncomeData();
  void doLogin();
  void showState(QAbstractSocket::SocketState);

private:
  QString server;
  int     port;
  QString login;
  QString password;

signals:
  void lineReaded( const QString& );
};

#endif
